<!doctype html>
<html>
{include file="head.html"}

<body>
<div class="header" style="">
<a class="left-btn" href="{$appshop}?m=kdyuan_order"><span class="iconfont icon-back"></span></a>
<div class="title">快递员订单分配</div>
</div>
<div class="main-body">
<form id="form">
<input type="hidden" name="id" id="id" value="{$data.id}">
<div class="input-row"><input type="text" name="money" value="{$data.money}" id="money"><label>价格(元)</label></div>
<div class="input-row"><input type="text" id="address" value="{$data.address}" name="address" > <label>收货地址</label></div>
<div class="input-row">
	{get data=kdylist model=kdyuan fun=select()}
    <select class="txt" name="kid" id="kid">
    	<option value="0">请选择快递员</option>
        {foreach item=c from=$kdylist}
        <option value="{$c.id}" {if $c.id eq $data.id} selected{/if}>{$c.title}</option>
        {/foreach}
    </select>
</div>
<div class="input-row"><input type="text" id="fcontact" value="{if $data}{$data.fcontact}{else}{$shop.shopname}{/if}" name="fcontact" > <label>发货人</label></div>
<div class="textarea-row">
	<textarea name="content" id="content" placeholder="送货内容"></textarea>
</div>

<div class="form-btns">
	<button id="submit" type="button" class="btn btn-row">分配订单</button>
</div>

</div>
<script>
            $(function(){
				$("#submit").on("click",function(){
					if($("#content").val()=='' || $("#address").val()=='' || $("#money").val()==''){
						skyToast('请填写完整信息');
						return false;
					}
					$.post("{$appshop}?m=kdyuan_order&a=save&ajax=1",$("#form").serialize() ,function(data){
						if(data.error==0){
							skyToast('配送成功');
							if($("#id").val()==''){
								$("#money").val('');
								$("#content").val('');
								$("#address").val('');
							}
						}else{
							skyToast(data.message);
						}
					},"json")
				});
			});
            
            </script>
{include file="footer.html"}
</body>
</html>
